package org.sith.gl.taskmanager.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import org.sith.gl.taskmanager.client.beans.UserEntityGWT;

import java.util.List;


@RemoteServiceRelativePath("UsersRemoteService")
public interface UsersRemoteService extends RemoteService {
    List<UserEntityGWT> getAllUsers();

    /**
     * Utility/Convenience class.
     * Use UsersRemoteService.App.getInstance() to access static instance of UsersRemoteServiceAsync
     */
    public static class App {
        private static final UsersRemoteServiceAsync ourInstance = (UsersRemoteServiceAsync) GWT.create(UsersRemoteService.class);

        public static UsersRemoteServiceAsync getInstance() {
            return ourInstance;
        }
    }
}
